﻿namespace EasyCMS.Common
{
    using System;

    using System.Collections.Generic;
    using Pismire;

    /// <summary>
    /// 数据分区，全表缓冲
    /// </summary>
    [System.ServiceModel.ServiceContractAttribute(ConfigurationName = "EasyCMS.Common.IPartitions")]
    public interface IPartitions
    {
        /// <summary>
        /// 根据ID获取分区数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/GetByID", ReplyAction = "http://tempuri.org/IPartitions/GetByIDResponse")]
        EasyCMS.Common.DataComponents.Partition GetByID(int id);

        /// <summary>
        /// 根据Mark获取分区数据
        /// </summary>
        /// <param name="codeName"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/GetByMark", ReplyAction = "http://tempuri.org/IPartitions/GetByMarkResponse")]
        EasyCMS.Common.DataComponents.Partition GetByMark(string mark);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/GetList", ReplyAction = "http://tempuri.org/IPartitions/GetListResponse")]
        List<EasyCMS.Common.DataComponents.Partition> GetList(EasyCMS.Common.Querys.Partition query);

        /// <summary>
        /// 查询数据集合
        /// </summary>
        /// <param name="query"></param>
        /// <param name="recordCount"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/GetListFull", ReplyAction = "http://tempuri.org/IPartitions/GetListFullResponse")]
        List<EasyCMS.Common.DataComponents.Partition> GetList(EasyCMS.Common.Querys.Partition query, out int recordCount);

        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/Add", ReplyAction = "http://tempuri.org/IPartitions/AddResponse")]
        ExcuteState Add(ref EasyCMS.Common.DataComponents.Partition partition);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/Update", ReplyAction = "http://tempuri.org/IPartitions/UpdateResponse")]
        ExcuteState Update(ref EasyCMS.Common.DataComponents.Partition partition);

        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/Delete", ReplyAction = "http://tempuri.org/IPartitions/DeleteResponse")]
        ExcuteState Delete(int id);

        /// <summary>
        /// 创建一个新的内容数据分区
        /// </summary>
        /// <param name="partition"></param>
        /// <returns></returns>
        [System.ServiceModel.OperationContractAttribute(IsOneWay = false, Action = "http://tempuri.org/EasyCMS.Common.IPartitions/CreatePartition", ReplyAction = "http://tempuri.org/IPartitions/CreatePartitionResponse")]
        ExcuteState CreatePartition(ref DataComponents.Partition partition);
    }
}
